<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bluetooth LE Mesh Library: Mesh OnOff Client</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Bluetooth LE Mesh Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__wiced__bt__mesh__onoff__client.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Mesh OnOff Client<div class="ingroups"><a class="el" href="group__wiced__bt__mesh.html">LE Mesh</a> &raquo; <a class="el" href="group__wiced__bt__mesh__models.html">Mesh Models Library API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>The AIROC Mesh On/Off Client module of the Mesh Models library provides a way for an application to send OnOff commands to the server and optionally receive status information. </p>
<p>To include On/Off functionality, the device description shall contain <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga891ae2d88c30f0ebd1ba36fc327ffec4">WICED_BT_MESH_MODEL_ONOFF_CLIENT</a>. To implement a device which supports multiple switches, the <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga891ae2d88c30f0ebd1ba36fc327ffec4">WICED_BT_MESH_MODEL_ONOFF_CLIENT</a> shall be included in multiple elements. Based on this information, the device that performs configuration will be able to specify different destination for every switch.</p>
<p>In a simplest form, an application needs to initialize using the <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa">wiced_bt_mesh_model_onoff_client_init</a> function and then call <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga3d456b1f9a9c0b2ff58361ecc99520ad">wiced_bt_mesh_model_onoff_client_set</a> to tell the Mesh Library to send a command. The configuration of the destination address and security credential is done during the provisioning/configuration process and the application does not need to worry about it.</p>
<p>If an application needs more control of how messages are sent out, it can use <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga4ce52a7d57bd8cba120ad2925962b60d">wiced_bt_mesh_model_onoff_client_send_get</a> and <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga1e7739e0b5f369e9f5c236be43a7e71e">wiced_bt_mesh_model_onoff_client_send_set</a> functions. These functions require to use the p_event parameter which include among others address of the desgination, application key index, retrnansmission parameters, TTL, and various others. After creating the event, the application can adjust the paramters as needed.</p>
<p>To receive On/Off status information, an application during initialization specifies the callback that will be executed when OnOff status message is received. The status information can be received as a result of sending On/Off Get and Set commands. In addition to that, the On/Off server can be configured to send the status information to the device that implements the OnOff Client module, or to a group of the devices to which the OnOff Client belongs. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga891ae2d88c30f0ebd1ba36fc327ffec4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga891ae2d88c30f0ebd1ba36fc327ffec4">WICED_BT_MESH_MODEL_ONOFF_CLIENT</a>&#160;&#160;&#160;{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_CLNT, <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga673750835549336e8128e8c6d630441f">wiced_bt_mesh_model_onoff_client_message_handler</a>, NULL, NULL }</td></tr>
<tr class="memdesc:ga891ae2d88c30f0ebd1ba36fc327ffec4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mesh On/Off Client Device.  <a href="#ga891ae2d88c30f0ebd1ba36fc327ffec4">More...</a><br /></td></tr>
<tr class="separator:ga891ae2d88c30f0ebd1ba36fc327ffec4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga225edd7412e2ba02d4f1614ebdddef55"><td class="memItemLeft" align="right" valign="top">typedef void()&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga225edd7412e2ba02d4f1614ebdddef55">wiced_bt_mesh_onoff_client_callback_t</a>(uint16_t event, <a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, void *p_data)</td></tr>
<tr class="memdesc:ga225edd7412e2ba02d4f1614ebdddef55"><td class="mdescLeft">&#160;</td><td class="mdescRight">On/Off Client callback is called by the Mesh Models library on receiving a On/Off status message from the peer.  <a href="#ga225edd7412e2ba02d4f1614ebdddef55">More...</a><br /></td></tr>
<tr class="separator:ga225edd7412e2ba02d4f1614ebdddef55"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa">wiced_bt_mesh_model_onoff_client_init</a> (uint8_t element_idx, <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga225edd7412e2ba02d4f1614ebdddef55">wiced_bt_mesh_onoff_client_callback_t</a> *p_callback, wiced_bool_t is_provisioned)</td></tr>
<tr class="memdesc:ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">On/Off Client Module initialization.  <a href="#ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa">More...</a><br /></td></tr>
<tr class="separator:ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga673750835549336e8128e8c6d630441f"><td class="memItemLeft" align="right" valign="top">wiced_bool_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga673750835549336e8128e8c6d630441f">wiced_bt_mesh_model_onoff_client_message_handler</a> (<a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, uint8_t *p_data, uint16_t data_len)</td></tr>
<tr class="memdesc:ga673750835549336e8128e8c6d630441f"><td class="mdescLeft">&#160;</td><td class="mdescRight">On/Off Client Message Handler.  <a href="#ga673750835549336e8128e8c6d630441f">More...</a><br /></td></tr>
<tr class="separator:ga673750835549336e8128e8c6d630441f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga48f7caf8978568cec1f508ca4934ccf0"><td class="memItemLeft" align="right" valign="top">wiced_result_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga48f7caf8978568cec1f508ca4934ccf0">wiced_bt_mesh_model_onoff_client_get</a> (uint8_t element_idx)</td></tr>
<tr class="memdesc:ga48f7caf8978568cec1f508ca4934ccf0"><td class="mdescLeft">&#160;</td><td class="mdescRight">The application can call this function to send get On/Off state client message to the server.  <a href="#ga48f7caf8978568cec1f508ca4934ccf0">More...</a><br /></td></tr>
<tr class="separator:ga48f7caf8978568cec1f508ca4934ccf0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4ce52a7d57bd8cba120ad2925962b60d"><td class="memItemLeft" align="right" valign="top">wiced_result_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga4ce52a7d57bd8cba120ad2925962b60d">wiced_bt_mesh_model_onoff_client_send_get</a> (<a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event)</td></tr>
<tr class="memdesc:ga4ce52a7d57bd8cba120ad2925962b60d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The application can call this function to send get On/Off state client message to the server.  <a href="#ga4ce52a7d57bd8cba120ad2925962b60d">More...</a><br /></td></tr>
<tr class="separator:ga4ce52a7d57bd8cba120ad2925962b60d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d456b1f9a9c0b2ff58361ecc99520ad"><td class="memItemLeft" align="right" valign="top">wiced_result_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga3d456b1f9a9c0b2ff58361ecc99520ad">wiced_bt_mesh_model_onoff_client_set</a> (uint8_t element_idx, <a class="el" href="structwiced__bt__mesh__onoff__set__data__t.html">wiced_bt_mesh_onoff_set_data_t</a> *p_data)</td></tr>
<tr class="memdesc:ga3d456b1f9a9c0b2ff58361ecc99520ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">The application can call this function to send On/Off command.  <a href="#ga3d456b1f9a9c0b2ff58361ecc99520ad">More...</a><br /></td></tr>
<tr class="separator:ga3d456b1f9a9c0b2ff58361ecc99520ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e7739e0b5f369e9f5c236be43a7e71e"><td class="memItemLeft" align="right" valign="top">wiced_result_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga1e7739e0b5f369e9f5c236be43a7e71e">wiced_bt_mesh_model_onoff_client_send_set</a> (<a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, <a class="el" href="structwiced__bt__mesh__onoff__set__data__t.html">wiced_bt_mesh_onoff_set_data_t</a> *p_data)</td></tr>
<tr class="memdesc:ga1e7739e0b5f369e9f5c236be43a7e71e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The application can call this function to send Set OnOff client message to the server.  <a href="#ga1e7739e0b5f369e9f5c236be43a7e71e">More...</a><br /></td></tr>
<tr class="separator:ga1e7739e0b5f369e9f5c236be43a7e71e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga891ae2d88c30f0ebd1ba36fc327ffec4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga891ae2d88c30f0ebd1ba36fc327ffec4">&#9670;&nbsp;</a></span>WICED_BT_MESH_MODEL_ONOFF_CLIENT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WICED_BT_MESH_MODEL_ONOFF_CLIENT&#160;&#160;&#160;{ MESH_COMPANY_ID_BT_SIG, WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_CLNT, <a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga673750835549336e8128e8c6d630441f">wiced_bt_mesh_model_onoff_client_message_handler</a>, NULL, NULL }</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Mesh On/Off Client Device. </p>
<p>The device implements a Generic On/Off switch. The device can be configured to control any device that supports Generic On/Off Server model (WICED_BT_MESH_CORE_MODEL_ID_GENERIC_ONOFF_SRV). For example, a <a class="el" href="group__wiced__bt__mesh__light__ctl__server.html#ga31d00ceb59ef7db4fc28879b20509808">WICED_BT_MESH_MODEL_LIGHT_CTL_SERVER</a>, <a class="el" href="group__wiced__bt__mesh__light__hsl__server.html#gab330cac44df7024819bff2f0d94b72e8">WICED_BT_MESH_MODEL_LIGHT_HSL_SERVER</a>,... </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga225edd7412e2ba02d4f1614ebdddef55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga225edd7412e2ba02d4f1614ebdddef55">&#9670;&nbsp;</a></span>wiced_bt_mesh_onoff_client_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void() wiced_bt_mesh_onoff_client_callback_t(uint16_t event, <a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, void *p_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>On/Off Client callback is called by the Mesh Models library on receiving a On/Off status message from the peer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">event</td><td>The event that the application should process (see <a class="el" href="wiced__bt__mesh__models_8h.html#ONOFF_EVENT">Mesh On/Off Events</a>) </td></tr>
    <tr><td class="paramname">p_event</td><td>information about the message received. It is application responsibility to release the event using <a class="el" href="group__wiced__bt__mesh__core.html#gab53118d6d25849be44f82d3af7eeb0db">wiced_bt_mesh_release_event</a>. </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the data to send</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga05dc5ec90d2ad8a1e9ce1d64c4fc85fa">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_client_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wiced_bt_mesh_model_onoff_client_init </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>element_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__wiced__bt__mesh__onoff__client.html#ga225edd7412e2ba02d4f1614ebdddef55">wiced_bt_mesh_onoff_client_callback_t</a> *&#160;</td>
          <td class="paramname"><em>p_callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wiced_bool_t&#160;</td>
          <td class="paramname"><em>is_provisioned</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>On/Off Client Module initialization. </p>
<p>The function shall be called to initialize the On/Off Module of the Mesh Models library. For multi element applications, the initialization shall be done for each element that supports On/Off get/set functionality. The p_callback parameter may be set to NULL if no On/Off Status processing is required.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Device element to where model is used </td></tr>
    <tr><td class="paramname">p_callback</td><td>The application callback function that will be executed by the mesh models library when application action is required, or when a reply for the application request has been received. </td></tr>
    <tr><td class="paramname">is_provisioned</td><td>If TRUE, the application is being restarted after being provisioned or after a power loss.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a id="ga673750835549336e8128e8c6d630441f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga673750835549336e8128e8c6d630441f">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_client_message_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_bool_t wiced_bt_mesh_model_onoff_client_message_handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *&#160;</td>
          <td class="paramname"><em>p_event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>On/Off Client Message Handler. </p>
<p>This is an internal Mesh Models library function and does not need to be implemented or called by the application, unless application wants to replace the library functionality. The Mesh Core library calls this function for each message received. The function shall return WICED_TRUE if the message is destined for this specific model, and returns WICED_FALSE otherwise.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_event</td><td>Mesh event with information about received message. </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the data portion of the message </td></tr>
    <tr><td class="paramname">data_len</td><td>Length of the data in the message</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_TRUE if the message is for this company ID/Model/Element Index combination, WICED_FALSE otherwise. </dd></dl>

</div>
</div>
<a id="ga48f7caf8978568cec1f508ca4934ccf0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga48f7caf8978568cec1f508ca4934ccf0">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_client_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_result_t wiced_bt_mesh_model_onoff_client_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>element_idx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The application can call this function to send get On/Off state client message to the server. </p>
<p>Model library will send the message out only if the OnOff Client model is configured by the provisioner for publication.</p>
<p>If the application has registerd the callback during the initialization, the callback will be executed twice, first with <a class="el" href="group__wiced__bt__mesh__provisioning.html#ga31c4c354e12fd933b285fe399a6559bf">WICED_BT_MESH_TX_COMPLETE</a> event indicating that the event has been sent out and then with WICED_BT_MESH_ONOFF_STATUS event with the status information.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Element Index of the model</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_BT_SUCCESS if message has been queued for transmission. </dd></dl>

</div>
</div>
<a id="ga4ce52a7d57bd8cba120ad2925962b60d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4ce52a7d57bd8cba120ad2925962b60d">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_client_send_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_result_t wiced_bt_mesh_model_onoff_client_send_get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *&#160;</td>
          <td class="paramname"><em>p_event</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The application can call this function to send get On/Off state client message to the server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_event</td><td>Mesh event with the information about the message that has been created by the app for unsolicited message.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_BT_SUCCESS if message has been queued for transmission. </dd></dl>

</div>
</div>
<a id="ga3d456b1f9a9c0b2ff58361ecc99520ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d456b1f9a9c0b2ff58361ecc99520ad">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_client_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_result_t wiced_bt_mesh_model_onoff_client_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>element_idx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__onoff__set__data__t.html">wiced_bt_mesh_onoff_set_data_t</a> *&#160;</td>
          <td class="paramname"><em>p_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The application can call this function to send On/Off command. </p>
<p>The application does not need to know the destination of the command or application key that will be used to secure the packet. The Mesh Models library will send the message out only if the OnOff Client model of the referenced element is configured by the provisioner for publication.</p>
<p>If the application has registered the callback during the initialization, the callback will be executed with <a class="el" href="group__wiced__bt__mesh__provisioning.html#ga31c4c354e12fd933b285fe399a6559bf">WICED_BT_MESH_TX_COMPLETE</a> event indicating that the event has been sent out. The OnOff command is sent not requiring acknowledgment. The WICED_BT_MESH_ONOFF_STATUS event will only be executed only if the provisioner configured the recipient of the command to publish the status data to this element, or to a group to which this element belongs to.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Element Index of the model </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the data to send</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_BT_SUCCESS if message has been queued for transmission. </dd></dl>

</div>
</div>
<a id="ga1e7739e0b5f369e9f5c236be43a7e71e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e7739e0b5f369e9f5c236be43a7e71e">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_onoff_client_send_set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_result_t wiced_bt_mesh_model_onoff_client_send_set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *&#160;</td>
          <td class="paramname"><em>p_event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__onoff__set__data__t.html">wiced_bt_mesh_onoff_set_data_t</a> *&#160;</td>
          <td class="paramname"><em>p_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The application can call this function to send Set OnOff client message to the server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_event</td><td>Mesh event with the information about the message that has been created by the app for unsolicited message. </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the data to send</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_BT_SUCCESS if message has been queued for transmission. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Bluetooth LE Mesh Library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
</body>
</html>
